import {notification} from "antd";
import config from "../../config.json"

class ToastUtils {


    /**
     * 普通成功通知弹框
     * @param message  消息
     */
    static success(message) {
        notification.success({
            description: message, message: config.application.appName, placement: "topLeft", rtl: true
        })
    }


    /**
     * 普通失败通知弹框
     * @param message  消息
     */
    static error(message) {
        notification.error({description: message, message: config.application.appName, placement: "topLeft", rtl: true})
    }


    /**
     * 普通成功通知弹框 带进度条
     * @param message  消息
     */
    static progressSuccess(message) {
        notification.success({
            description: message,
            message: config.application.appName,
            placement: "topLeft",
            showProgress: true,
            rtl: true
        })
    }

    /**
     * 普通失败通知弹框 带进度条
     * @param message  消息
     */
    static progressError(message) {
        notification.error({
            description: message,
            message: config.application.appName,
            placement: "topLeft",
            showProgress: true,
            rtl: true
        })
    }
}

export default ToastUtils